#include <stdlib.h>
#include <time.h>
#include <stdio.h>

float randFloat() {
  float t = rand()/(float)RAND_MAX;
  float i = rand();

  return t+i;
}

/* Saxpy */
int main(const int argc, const char* argv[])
{
  int n, i;
  float *x, *y;
  float a;
  srand(time(NULL));

  //if (argc != 2)
    //exit(1);

  a = randFloat();
  //n = atoi(argv[1]);
  n= 1000;

  x = malloc(n*sizeof(float));
  y = malloc(n*sizeof(float));
  for(i=0; i<n; i++) {
    x[i] = randFloat();
    y[i] = randFloat();
  }
  for(i=0; i<n; i++) {
    y[i] = x[i]*a + y[i];
	printf("%f", y[i]);
  }

  return 0;
}
